
package ch.hearc.meteo.spec.meteo;

import ch.hearc.meteo.imp.com.real.MeteoService;
import ch.hearc.meteo.imp.com.real.com.ComConnexion;
import ch.hearc.meteo.imp.com.real.com.ComOption;

public class MeteoServiceFactory
	{

	/*------------------------------------------------------------------*\
	|*							Constructeurs							*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Methodes Public							*|
	\*------------------------------------------------------------------*/

	/*------------------------------*\
	|*			  Static			*|
	\*------------------------------*/

	/**
	 * <pre>
	 * Example:
	 * 		Windows : namePort=COM1
	 * 		Linux	: ??
	 * 		Mac 	: ??
	 * </pre>
	 */
	public static MeteoService_I create(String portName, MeteoServiceOptions meteoServiceOption, ComOption comOptions)
		{
		//return null; // TODO
		// Simulateur
		//return new MeteoServiceSimulateur(portName, meteoServiceOption);

		// Réél
		//		ComOption comOptions = new ComOption();
		ComConnexion comConnexion = new ComConnexion(portName, comOptions);
		MeteoService meteoService = new MeteoService(comConnexion, meteoServiceOption);
		comConnexion.setMeteoServiceCallback(meteoService);
		return meteoService;
		}

	/*------------------------------------------------------------------*\
	|*							Methodes Private						*|
	\*------------------------------------------------------------------*/

	/*------------------------------------------------------------------*\
	|*							Attributs Private						*|
	\*------------------------------------------------------------------*/
	}
